﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="CategoryEdit.aspx.cs" Inherits="AnOtherBlog.AJAX.Admin.Posts.CategoryEdit" Title="Category Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<%--
	<div class="framecontentMsg">
		<asp:Label id="lblMsg" runat="server" EnableViewState="False" CssClass="lblMsg"></asp:Label>
	</div>
--%>
	<div id="mainContentRegion">
		<div id="admin_centercontent">
			<div class="sectionHeader">
				<asp:Label ID="lblCategoryAdministration" runat="server" Text="<%$ Resources:AdminPosts,lblCategoryAdministration %>" />
			</div>

			<asp:Panel ID="pnlCategoryList" runat="server" GroupingText="<%$ Resources:AdminPosts,pnlCategoryList %>">

				<asp:GridView ID="gvCategory" runat="server" 
					AutoGenerateColumns="False" 
					CellPadding="1" CellSpacing="1" 
					AllowPaging="True" PageSize="4" 
					Font-Size="1em" 
					GridLines="Horizontal" 
					DataKeyNames="CategoryID" 
					>
					<HeaderStyle Font-Size="Smaller" />
					<PagerStyle Font-Size="Small" />
					<AlternatingRowStyle ForeColor="Fuchsia" />
					<SelectedRowStyle Font-Italic="True" />
					<PagerSettings Mode="NumericFirstLast" />
					<Columns>
						<asp:TemplateField HeaderText="CategoryID" InsertVisible="False" ShowHeader="False" Visible="False" >
							<HeaderStyle HorizontalAlign="Center" />
							<ItemTemplate>
								<asp:Label ID="lblCategoryID" runat="server" Text='<%# Eval("CategoryID") %>'></asp:Label>
							</ItemTemplate>
						</asp:TemplateField>
						
						<asp:TemplateField HeaderText="T&iacute;tulo" SortExpression="CategoryName" >
							<ItemStyle Width="200px" />
							<ControlStyle Width="180px" />
							<ItemTemplate>
								<asp:Label ID="lblCategoryName" runat="server" Text='<%# Eval("CategoryName") %>' ></asp:Label>
							</ItemTemplate>
							<EditItemTemplate>
								<asp:TextBox ID="txtCategoryName" runat="server" Text='<%# Bind("CategoryName") %>' MaxLength="50" Width="180px" ></asp:TextBox>
								<asp:RequiredFieldValidator ID="rfvCategoryName" runat="server" 
									ControlToValidate="txtCategoryName" 
									ValidationGroup="vgCategoryEdit" 
									SetFocusOnError="True" 
									ErrorMessage="Falta T&iacute;tulo" 
									ToolTip="Falta T&iacute;tulo" 
									>*</asp:RequiredFieldValidator>
							</EditItemTemplate>
						</asp:TemplateField>

						<asp:TemplateField HeaderText="Descripci&oacute;n" >
							<ItemStyle Width="320px" />
							<ControlStyle Width="300px" />
							<ItemTemplate>
								<asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>' ></asp:Label>
							</ItemTemplate>
						</asp:TemplateField>

						<asp:TemplateField ShowHeader="False">
							<HeaderStyle Width="100px" />
							<ItemStyle HorizontalAlign="Center" Width="150px" />
							<ItemTemplate>
								<asp:ImageButton ID="ibEdit" runat="server" CausesValidation="False" 
									CommandName="Edit" ImageUrl="~/Icons/ico_edit.gif" Text="Editar" ToolTip="Editar" />

								<asp:ImageButton ID="ibDelete" runat="server" CausesValidation="False" 
									CommandName="Delete" ImageUrl="~/Icons/ico_delete.gif" Text="Eliminar" ToolTip="Eliminar" 
									OnClientClick="javascript:return(window.confirm('Esta Seguro?'))" 
								/>

							</ItemTemplate>
						</asp:TemplateField>

					</Columns>
				</asp:GridView>
			</asp:Panel>

			<asp:Panel ID="pnlCategoryEdit" runat="server" GroupingText="<%$ Resources:AdminPosts,pnlCategoryEdit %>">
				<asp:Label ID="lblCategoryName" runat="server" AssociatedControlID="txtCategoryName" CssClass="labelblock" Text="<%$ Resources:AdminPosts,lblTitle %>"></asp:Label>
				<asp:TextBox ID="txtCategoryName" runat="server" CssClass="textboxlong" Width="600px" MaxLength="50" ></asp:TextBox>
				<asp:RequiredFieldValidator ID="rfvCategoryName" runat="server" 
					ControlToValidate="txtCategoryName" 
					ValidationGroup="vgCategoryEdit" 
					SetFocusOnError="True" 
					ErrorMessage="<%$ Resources:AdminPosts,rfvCategoryName %>" 
					ToolTip="<%$ Resources:AdminPosts,rfvCategoryName %>" 
					>*</asp:RequiredFieldValidator>
				<br />
				<asp:Label ID="lblDescription" runat="server" AssociatedControlID="txtDescription" CssClass="labelblock" Text="<%$ Resources:AdminPosts,lblDescription %>"></asp:Label>
				<asp:TextBox ID="txtDescription" runat="server" CssClass="textboxmultilinelong" Width="600px" MaxLength="200" ></asp:TextBox>
				<br />
				<asp:Button ID="btnSave" runat="server" Text="<%$ Resources:AdminPosts,btnSave %>"  CssClass="buttonmodal" ValidationGroup="vgCategoryEdit" />
				<asp:Button ID="btnCancel" runat="server" Text="<%$ Resources:AdminPosts,btnCancel %>"  CssClass="buttonmodal" />
			</asp:Panel>

			<div style="clear:both;">
				<asp:ValidationSummary ID="vsCategoryEdit" runat="server" ValidationGroup="vgCategoryEdit" DisplayMode="SingleParagraph" HeaderText="Errores" />
			</div>

	</div>
</div>
</asp:Content>
